import MenuFileColor from '~icons/local/menu-file-color'
import FileImageColor from '~icons/local/file-image-color'
import FileText from '~icons/local/file-txt-color'
import FileVideoColor from '~icons/local/file-video-color'
import FileMusic from '~icons/local/file-music-color'
import FileOther from '~icons/local/file-other-color'

export interface FileTypeListItem {
  name: string
  value: string
  icon: any
}

/** 文件分类 */
export const FileTypeList: FileTypeListItem[] = [
  { name: '全部', value: 'ALL', icon: MenuFileColor },
  { name: '图片', value: 'IMAGE', icon: FileImageColor },
  { name: '文档', value: 'DOC', icon: FileText },
  { name: '视频', value: 'VIDEO', icon: FileVideoColor },
  { name: '音频', value: 'AUDIO', icon: FileMusic },
  { name: '其他', value: 'UNKNOWN', icon: FileOther },
]

export interface FileExtendNameIconMap {
  [key: string]: string
}

/** 文件类型图标 Map 映射 */
export const FileIcon: FileExtendNameIconMap = {
  mp3: 'file-music-color',
  mp4: 'file-video-color',
  dir: 'file-dir-color',
  ppt: 'file-ppt-color',
  doc: 'file-wps-color',
  docx: 'file-wps-color',
  xls: 'file-excel-color',
  xlsx: 'file-excel-color',
  txt: 'file-txt-color',
  rar: 'file-rar-color',
  zip: 'file-zip-color',
  html: 'file-html-color',
  css: 'file-css-color',
  js: 'file-js-color',
  other: 'file-other-color', // 未知文件
}

/** 图片类型 */
export const ImageTypes = ['jpg', 'png', 'gif', 'jpeg']

/** WPS、Office文件类型 */
export const OfficeTypes = ['ppt', 'pptx', 'doc', 'docx', 'xls', 'xlsx']
